import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:ichinesereader/pages/login/loginReactive.dart';

import '../../themes/appTheme.dart';
import 'package:pointer_interceptor/pointer_interceptor.dart';

class AccountSuccessDialog extends StatelessWidget {
  AccountSuccessDialog({
    Key? key,
    required this.title,
    required this.message,
  }) : super(key: key);
  final String title;
  final String message;

  @override
  Widget build(BuildContext context) {
    return PointerInterceptor(
        intercepting: true,
        child: AlertDialog(
          title: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Text(
                this.title,
                style: TextStyle(
                    fontSize: 30.0,
                    decoration: TextDecoration.underline,
                    decorationStyle: TextDecorationStyle.dotted),
              ),
              InkWell(
                onTap: () {
                  Navigator.of(context).pop();
                },
                child: Icon(Icons.cancel,
                    color: Get.isDarkMode ? Colors.white : Colors.blueGrey),
              ),
            ],
          ),
          titleTextStyle: TextStyle(
            letterSpacing: 1,
            color: Get.isDarkMode ? Colors.white : Colors.blueGrey,
            fontSize: 21,
          ),
          backgroundColor:
              Get.isDarkMode ? AppTheme.colors.darkTheme2 : Colors.white,
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.all(
              Radius.circular(3.0),
            ),
          ),
          content: Container(
            width: 450.0,
            height: 300.0,
            child: Column(
              children: [
                // Text(
                //   this.message,
                //   style: TextStyle(
                //     fontSize: 18.0,
                //     color:
                //         Get.isDarkMode ? Get.theme.primaryColorDark : Colors.blueGrey,
                //   ),
                // ),
                OutlinedButton(
                    child: Text('Go to login page'.tr,
                        style: TextStyle(
                            fontSize: 16, fontWeight: FontWeight.w500)),
                    onPressed: () {
                      Get.to(() => LoginReactive());
                    })
              ],
            ),
          ),
        ));
  }
}
